﻿//Write an expression that checks for given point (x, y) if it is within the circle K( (1,1), 3) 
//and out of the rectangle R(top=1, left=-1, width=6, height=2).

using System;

namespace InCircleOutRectangle
{
    class NumberLimits
    {
        static void Main()
        {
            Console.Write("Please enter x: ");
            int x = int.Parse(Console.ReadLine());
            Console.Write("Please enter y: ");
            int y = int.Parse(Console.ReadLine());

            if (((x - 1) * (x - 1) + (y - 1) * (y - 1)) <= 9)
            {
                Console.WriteLine("The point is within the circle.");
                if ((x < (-1)) || (x > 5))
                {
                    Console.WriteLine("The point is out of the rectangle.");
                }
                else
                    if (y > 1 || y < (-1))
                    {
                        Console.WriteLine("The point is out of the rectangle.");
                    }
                    else
                        if (((x > (-1)) || (x < 5)) && (y < 1 || y > (-1)))
                        {
                            Console.WriteLine("The point is within the rectangle.");
                        }

            }
            else
            {
                Console.WriteLine("The point is out of the circle.");
                if ((x < (-1)) || (x > 5))
                {
                    Console.WriteLine("The point is out of the rectangle.");
                }
                else
                    if (y > 1 || y < (-1))
                    {
                        Console.WriteLine("The point is out of the rectangle.");
                    }
                    else
                        if (((x > (-1)) || (x < 5)) && (y < 1 || y > (-1)))
                        {
                            Console.WriteLine("The point is within the rectangle.");
                        }
            }
        }
    }
}
